<template>
    <el-text type="primary" size="large" tag="b">2,添加在父容器上的语法 display : flex;flex-direction 主轴排列方式</el-text>
    <div class="content_box">
        <div class="child_content_box">
            <el-text class="mx-1">flex-direction:row(默认)</el-text>
            <div class="flex_direction_row">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text class="mx-1">flex-direction:row-reverse</el-text>
            <div class="row_reverse">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text class="mx-1">flex-direction:column</el-text>
            <div class="row_column">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text class="mx-1">flex-direction:column-reverse</el-text>
            <div class="column_reverse">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
    </div>
</template>
<script setup >

</script>
<style scoped lang="scss">
.content_box {
    display: flex;
    flex-wrap: wrap;
}

.child_content_box {
    margin: 5px;
}

.flex_direction_row {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    flex-direction: row;
}

.row_reverse {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    flex-direction: row-reverse;
}

.row_column {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    flex-direction: column;
}

.column_reverse {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    flex-direction: column-reverse;
}

.child_before_box {
    width: 40px;
    height: 40px;
    margin: 2px;
    background-color: red;
}

.child_before_box:nth-child(2) {
    background-color: #F56C6C;
}

.child_before_box:nth-child(3) {
    background-color: yellow;
}

.child_before_box:nth-child(4) {
    background-color: green;
}
</style>